package chapter_3.demo7;

import java.util.Objects;

/**
 * @author: hero生仔
 */
public class Apple extends Fruit{
    private Integer weight;
    private String color;

    public Apple() {}

    public Apple(Integer weight) {
        this.weight = weight;
    }


    public Apple(String color, Integer weight) {
        this.weight = weight;
        this.color = color;
    }

//    @Override
//    public boolean equals(Object o) {
//        if (this == o) return true;
//        if (o == null || getClass() != o.getClass()) return false;
//        Apple apple = (Apple) o;
//        return Objects.equals(weight, apple.weight);
//    }
//
//    @Override
//    public int hashCode() {
//        return Objects.hash(weight);
//    }


    @Override
    public String toString() {
        return "Apple{" +
                "weight=" + weight +
                '}';
    }
}
